from random import choice


class Walk(object):

    def __init__(self, step):
        self.step = step
        self.x = [0]
        self.y = [0]

    def walk_random(self):
        while len(self.x) < self.step:
            x_fx = choice([1, -1])
            x_bs = choice(list(i for i in range(5)))
            x_value = x_bs*x_fx

            y_fx = choice([1, -1])
            y_bs = choice(list(i for i in range(5)))
            y_value = y_bs*y_fx

            if x_value == 0 and y_value == 0:
                continue

            next_x = self.x[-1] + x_value
            next_y = self.y[-1] + y_value

            self.x.append(next_x)
            self.y.append(next_y)
